<!-- 绿色通道 - 患者列表 - 医疗记录 主界面 -->
<template>
  <div id="box">
    <div class="topLine" style="">
      <div class="blueDot" style="" />
      <div style="float: left; margin-top: 8px"><span
          style="text-align: left; font-size: 20px; margin-left: 8px">医疗记录</span></div>
      <div class="fanhui_btn" style="float: right">
        <el-button type="info" plain @click="routerBack()">
          <span class="iconfont icon-fanhui" />
          返回
        </el-button>
      </div>
      <div style="clear: both" />
    </div>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <!-- <el-tab-pane label="急救进程" name="process">
        <process v-if="activeName == 'process'" :checkrowdata="mrdata" />
      </el-tab-pane> -->
      <el-tab-pane label="时间轴" name="process">
        <process v-if="activeName == 'process'" :checkrowdata="mrdata" />
      </el-tab-pane>
 

      <el-tab-pane v-if="consultation == false" label="基本信息" name="info"><info-trauma v-if="activeName == 'info'"
          :checkrowdata="mrdata" /></el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="病史" name="medicalHistoryTrauma">
        <medicalHistoryTrauma v-if="activeName == 'medicalHistoryTrauma'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <!-- <el-tab-pane v-if="consultation == false" label="120接诊/院内接诊" name="emergencyTreatment"><accepts-trauma v-if="activeName == 'emergencyTreatment'" patient-type="创伤" :checkrowdata="mrdata" /></el-tab-pane> -->
      <el-tab-pane v-if="consultation == false" label="生命体征" name="vitalSign">
        <vitalSign v-if="activeName == 'vitalSign'" patient-type="创伤" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="体格检查" name="healthCheckup">
        <healthCheckup v-if="activeName == 'healthCheckup'" patient-type="创伤" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="MPDS" name="mpdsTrauma">
        <mpds-Trauma v-if="activeName == 'mpdsTrauma'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="创伤评估" name="assessmentTrauma">
        <assessmentTrauma v-if="activeName == 'assessmentTrauma'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="其他处置" name="otherDisposalTrauma">
        <otherDisposalTrauma v-if="activeName == 'otherDisposalTrauma'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="辅助检查" name="accessoryExaminationTrauma">
        <accessoryExaminationTrauma v-if="activeName == 'accessoryExaminationTrauma'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="创伤抢救" name="emergencyRescue">
        <emergencyRescue v-if="activeName == 'emergencyRescue'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="麻醉手术" name="anesthesiaOperation">
        <anesthesiaOperation v-if="activeName == 'anesthesiaOperation'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="会诊" name="remoteConsultation">
        <remoteConsultation v-if="activeName == 'remoteConsultation'" patient-type="创伤" :checkrowdata="mrdata" />
      </el-tab-pane>
      <!-- <el-tab-pane v-if="consultation == false" label="急救抢救" name="emergencyRescue">
        <emergencyRescue v-if="activeName == 'emergencyRescue'" :checkrowdata="mrdata" />
      </el-tab-pane> -->
      <el-tab-pane v-if="consultation == false" label="转归" name="outcomeTrauma">
        <outcomeTrauma v-if="activeName == 'outcomeTrauma'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <el-tab-pane v-if="consultation == false" label="质控指标" name="qualityControlIndex">
        <qualityControlIndex v-if="activeName == 'qualityControlIndex'" :checkrowdata="mrdata" />
      </el-tab-pane>
      <!-- <el-tab-pane v-if="consultation == false" label="信息汇总" name="collectInformation">
        <collectInformation v-if="activeName == 'collectInformation'" :checkrowdata="mrdata" />
      </el-tab-pane> -->
    </el-tabs>
  </div>
</template>

<script>
import process from '@/views/green-channel/process.vue'
import infoTrauma from '@/views/green-channel/infoTrauma.vue'
import remoteConsultation from '@/views/green-channel/remoteConsultation.vue'
import acceptsTrauma from '@/views/green-channel/acceptsTrauma.vue'
import vitalSign from '@/views/green-channel/vitalSign.vue'
import healthCheckup from '@/views/green-channel/healthCheckup.vue'
import medicalHistoryTrauma from '@/views/green-channel/medicalHistoryTrauma.vue'
import mpdsTrauma from '@/views/green-channel/mpdsTrauma.vue'
import anesthesiaOperation from '@/views/green-channel/anesthesiaOperation.vue'
import qualityControlIndex from '@/views/green-channel/qualityControlIndex.vue'
// import checkUp from '@/views/green-channel/checkUp.vue'
// import nihssScoreStroke from '@/views/green-channel/nihssScoreStroke.vue'
import accessoryExaminationTrauma from '@/views/green-channel/accessoryExaminationTrauma.vue'
// import accessoryExaminationStroke from '@/views/green-channel/accessoryExaminationStroke.vue'
import emergencyRescue from '@/views/green-channel/emergencyRescue.vue'
import assessmentTrauma from '@/views/green-channel/assessmentTrauma.vue'
import collectInformation from '@/views/green-channel/collectInformation.vue'
import outcomeTrauma from '@/views/green-channel/outcomeTrauma.vue'
import otherDisposalTrauma from '@/views/green-channel/otherDisposalTrauma.vue'

// import bloodExaminationStroke from '@/views/green-channel/bloodExaminationStroke.vue'
// import strokeChoose from '@/views/green-channel/strokeChoose.vue'
// import basicInfoStoke from '@/views/green-channel/basicInfoStoke.vue'

// // import otherDisposalStroke from '@/views/green-channel/otherDisposalStroke.vue'
// import informedConsentList from '@/views/green-channel/informedConsentList.vue'
// import diagnosticEstimate from '@/views/green-channel/diagnosticEstimate.vue'
// import diagnosticEstimateStroke from '@/views/green-channel/diagnosticEstimateStroke.vue'
// import outcomeStroke from '@/views/green-channel/outcomeStroke.vue'
// import treatmentStroke from '@/views/green-channel/treatmentStroke.vue'

export default {
  // 由主页面(父组件) 接收来的, 选择项的数据
  components: {
    process,
    // infoStroke,
    infoTrauma,
    remoteConsultation,
    acceptsTrauma,
    // emergencyTreatment,
    vitalSign,
    medicalHistoryTrauma,
    mpdsTrauma,
    healthCheckup,
    // medicalHistoryStroke,
    // checkUp,
    // nihssScoreStroke,
    accessoryExaminationTrauma,
    qualityControlIndex,
    emergencyRescue,
    anesthesiaOperation,
    assessmentTrauma,
    collectInformation,
    outcomeTrauma,
    otherDisposalTrauma
    // accessoryExaminationStroke,
    // bloodExaminationStroke,
    // strokeChoose,
    // basicInfoStoke,
    // otherDisposalTrauma,
    // otherDisposalStroke,
    // informedConsentList,
    // diagnosticEstimate,
    // diagnosticEstimateStroke,
    // outcomeStroke,
    // treatmentStroke
  },
  props: ['mrdata'],
  data() {
    return {
      activeName: 'process',
      consultation: false // 是否由会诊tab页进入
    }
  },
  computed: {},
  updated() { },
  created() {
    console.log('接受要传的值', this.mrdata)
    console.log('是否由会诊tab页进入', this.mrdata.isConsultation) // true或false
    if (this.mrdata.isConsultation) {
      this.consultation = this.mrdata.isConsultation
      this.activeName = 'basicInfoStoke'
    }
    if (this.mrdata.state === 'creating') {
      this.activeName = 'info'
    }
  },
  mounted() {
    if (!!this.$store.getters.consultationsId && this.$store.getters.dataBus.dispatchId) {
      // cid有值 && dastabus有值
      // this.checkData = this.$store.getters.dataBus // checkData赋值
      this.consultation = true
      this.activeName = 'basicInfoStoke'
    }
  },
  methods: {
    handleClick(e, a) {
      console.log(e, a)
      // console.log(e, a)
      // console.log(this.activeName.toString())
      // console.log(this.activeName === 'strokeChoose')
    },
    routerBack() {
      this.$emit('medicalRecordsStrokeToFather') // 提醒父组件切换页面,达成返回效果
      // this.$emit('homePageToFather', data.dispatchId, data.patientId)
      // console.log(this.$router)
      // this.$router.back()
      // this.$router.go(-1) // 后退
      // debugger
      // this.$router.push('/green-channel/medicalRecords')
      // 接受子组件传来的dispatchId,patientId
      // console.log('传来的数据', dispatchId, patientId)
    }
  }
}
</script>

<style scoped>
.topLine {
  background-color: rgb(255, 255, 255);
  color: rgb(57, 68, 85);
  overflow: hidden;
  z-index: 9999;
  padding: 10px 20px;
  text-align: center;
  border-bottom: 10px solid rgb(242, 242, 242);
}

.blueDot {
  width: 15px;
  height: 15px;
  line-height: 30px;
  background-color: rgb(67, 128, 234);
  border-radius: 50%;
  float: left;
  margin-top: 15px;
}</style>
